package cn.wsalix.user.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import cn.anlaser.entity.BasicEntity;
import cn.wsalix.admin.entity.SysUser;
import cn.wsalix.type.GenderEnum;

@Entity
@Table(name = "USER_INFO")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Data
@EqualsAndHashCode(exclude = { "user" }, callSuper = false)
@ToString(exclude = { "user" })
public class UserInfo extends BasicEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3378291745602081638L;
	@Id
	private Long id;

	@OneToOne(optional = false, cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
	@MapsId
	@JoinColumn(name = "ID")
	private SysUser user;// 支付账号

	private String remark;// 描述

	private String username;
	private String nickname;
	private String realname;
	private String avatar;
	
	private String customerName;
	private String phone;
	private String address;

	
	private GenderEnum gender;// 性别
	private String birthday;
	private String email;
	private String identityCard;//身份证号

	private String homePhone;
	private String unitPhone;
	//private String cardNum;
	private String birthplace;
	private String permanentResidence;//常住地
	private String dept;//单位
	private String duty;	//职务
	//private String wealth;//供需资源
	private String liking;//爱好

	private String country;
	private String province;
	private String city;

	private String offset;
	private String offsetY;
	private String offsetX;
	private Date registerTime;
	@Column(columnDefinition = "int default 20", nullable = false)
	private int pageSize;
	@Column(columnDefinition = "int default 0", nullable = false)
	private int msgNum;// 未读消息数
	private boolean existShop;//用户主店铺ID
	
	private String nativePlace;// 籍贯

	private String wealth;//供需资源
	private String weixin;//手机
	private String qq;//手机
}
